package com.hech.hmall.service;

import com.hech.hmall.entity.UserEntity;
import com.hech.hmall.exception.UserException;

/**
 * @author hanjiafeng
 * @date 2021/5/6 20:56
 * @desc todo
 */
public interface IUserService {

    /**
     * 注册
     *
     * @param userEntity user
     * @return 状态
     */
    int register(UserEntity userEntity);

    /**
     * 检查建对应的值是否已经存在
     *
     * @param eleKey   键
     * @param eleValue 值
     * @return 是否存在
     */
    Boolean checkElement(String eleKey, String eleValue);

    /**
     * 登录
     *
     * @param account account
     * @param password password
     * @return 登陆后的用户
     * @throws UserException UserException
     */
    UserEntity login(String account, String password) throws UserException;
}
